{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 写于2023年8月26日\n",
    "### K最近邻算法解决分类问题\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2023-08-26T04:52:40.354183600Z",
     "start_time": "2023-08-26T04:52:40.322190900Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "数据集大小 (178, 13)\n",
      "数据分类 ['class_0' 'class_1' 'class_2']\n",
      "查看前五条数据 [[1.423e+01 1.710e+00 2.430e+00 1.560e+01 1.270e+02 2.800e+00 3.060e+00\n",
      "  2.800e-01 2.290e+00 5.640e+00 1.040e+00 3.920e+00 1.065e+03]\n",
      " [1.320e+01 1.780e+00 2.140e+00 1.120e+01 1.000e+02 2.650e+00 2.760e+00\n",
      "  2.600e-01 1.280e+00 4.380e+00 1.050e+00 3.400e+00 1.050e+03]\n",
      " [1.316e+01 2.360e+00 2.670e+00 1.860e+01 1.010e+02 2.800e+00 3.240e+00\n",
      "  3.000e-01 2.810e+00 5.680e+00 1.030e+00 3.170e+00 1.185e+03]\n",
      " [1.437e+01 1.950e+00 2.500e+00 1.680e+01 1.130e+02 3.850e+00 3.490e+00\n",
      "  2.400e-01 2.180e+00 7.800e+00 8.600e-01 3.450e+00 1.480e+03]\n",
      " [1.324e+01 2.590e+00 2.870e+00 2.100e+01 1.180e+02 2.800e+00 2.690e+00\n",
      "  3.900e-01 1.820e+00 4.320e+00 1.040e+00 2.930e+00 7.350e+02]]\n"
     ]
    }
   ],
   "source": [
    "import numpy as np\n",
    "from sklearn.datasets import load_wine\n",
    "from sklearn.model_selection import train_test_split\n",
    "from sklearn.neighbors import KNeighborsClassifier\n",
    "\n",
    "wine = load_wine()\n",
    "print(\"数据集大小\",wine.data.shape)\n",
    "print(\"数据分类\",wine.target_names)\n",
    "print(\"查看前五条数据\",wine.data[:5])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2023-08-26T04:56:00.582359700Z",
     "start_time": "2023-08-26T04:56:00.288353800Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "测试集精度 0.73\n"
     ]
    }
   ],
   "source": [
    "# 划分训练集和数据集\n",
    "X_train,X_test,y_train,y_test = train_test_split(wine.data,wine.target,random_state=0)\n",
    "# 构建Knn分类器\n",
    "knn_classifier = KNeighborsClassifier(n_neighbors=5)\n",
    "knn_classifier.fit(X_train,y_train)\n",
    "print(\"测试集精度\",round(knn_classifier.score(X_test,y_test),2))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2023-08-26T05:03:56.719872200Z",
     "start_time": "2023-08-26T05:03:56.638876900Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "最好的验证精度 0.68\n",
      "最好的参数组合 {'n_neighbors': 7}\n",
      "测试集精度 0.78\n"
     ]
    }
   ],
   "source": [
    "# 网格搜索\n",
    "from sklearn.model_selection import GridSearchCV\n",
    "grid_parameter = {'n_neighbors':[3,4,5,6,7,8]}\n",
    "grid = GridSearchCV(knn_classifier,grid_parameter,cv=5,n_jobs=-1)\n",
    "grid.fit(X_train,y_train)\n",
    "print(\"最好的验证精度\",round(grid.best_score_,2))\n",
    "print(\"最好的参数组合\",grid.best_params_)\n",
    "print(\"测试集精度\",round(grid.score(X_test,y_test),2))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 使用逻辑回归分类"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2023-08-26T05:06:26.133497700Z",
     "start_time": "2023-08-26T05:06:24.969895500Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "测试集精度 0.93\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "E:\\myAnaconda\\lib\\site-packages\\sklearn\\linear_model\\_logistic.py:762: ConvergenceWarning: lbfgs failed to converge (status=1):\n",
      "STOP: TOTAL NO. of ITERATIONS REACHED LIMIT.\n",
      "\n",
      "Increase the number of iterations (max_iter) or scale the data as shown in:\n",
      "    https://scikit-learn.org/stable/modules/preprocessing.html\n",
      "Please also refer to the documentation for alternative solver options:\n",
      "    https://scikit-learn.org/stable/modules/linear_model.html#logistic-regression\n",
      "  n_iter_i = _check_optimize_result(\n"
     ]
    }
   ],
   "source": [
    "from sklearn.linear_model import LogisticRegression\n",
    "logr_classification = LogisticRegression()\n",
    "logr_classification.fit(X_train,y_train)\n",
    "print(\"测试集精度\",round(logr_classification.score(X_test,y_test),2))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2023-08-26T05:12:16.664096800Z",
     "start_time": "2023-08-26T05:12:16.632809100Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "测试集精度 1.0\n"
     ]
    }
   ],
   "source": [
    "# 数组做标准化\n",
    "from sklearn.preprocessing import MinMaxScaler\n",
    "scaler = MinMaxScaler()\n",
    "scaler.fit(X_train)\n",
    "X_train_scaled = scaler.transform(X_train)\n",
    "X_test_scaled = scaler.transform(X_test)\n",
    "logr_classification.fit(X_train_scaled,y_train)\n",
    "print(\"测试集精度\",round(logr_classification.score(X_test_scaled,y_test),2))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2023-08-26T05:21:42.024578500Z",
     "start_time": "2023-08-26T05:21:39.622605600Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "最好的验证精度 0.96\n",
      "最好的参数组合 {'n_neighbors': 5}\n",
      "测试集精度 0.98\n"
     ]
    }
   ],
   "source": [
    "# 尝试用缩放后的数据\n",
    "grid.fit(X_train_scaled,y_train)\n",
    "print(\"最好的验证精度\",round(grid.best_score_,2))\n",
    "print(\"最好的参数组合\",grid.best_params_)\n",
    "print(\"测试集精度\",round(grid.score(X_test_scaled,y_test),2))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 写于2023年8月27日\n",
    "## 使用逻辑回归实现乳腺癌病情诊断"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2023-08-27T04:20:14.364759100Z",
     "start_time": "2023-08-27T04:20:07.467192600Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "数据形状 (569, 30)\n",
      "标签 ['malignant' 'benign']\n",
      "前5条数据\n",
      "[[1.799e+01 1.038e+01 1.228e+02 1.001e+03 1.184e-01 2.776e-01 3.001e-01\n",
      "  1.471e-01 2.419e-01 7.871e-02 1.095e+00 9.053e-01 8.589e+00 1.534e+02\n",
      "  6.399e-03 4.904e-02 5.373e-02 1.587e-02 3.003e-02 6.193e-03 2.538e+01\n",
      "  1.733e+01 1.846e+02 2.019e+03 1.622e-01 6.656e-01 7.119e-01 2.654e-01\n",
      "  4.601e-01 1.189e-01]\n",
      " [2.057e+01 1.777e+01 1.329e+02 1.326e+03 8.474e-02 7.864e-02 8.690e-02\n",
      "  7.017e-02 1.812e-01 5.667e-02 5.435e-01 7.339e-01 3.398e+00 7.408e+01\n",
      "  5.225e-03 1.308e-02 1.860e-02 1.340e-02 1.389e-02 3.532e-03 2.499e+01\n",
      "  2.341e+01 1.588e+02 1.956e+03 1.238e-01 1.866e-01 2.416e-01 1.860e-01\n",
      "  2.750e-01 8.902e-02]\n",
      " [1.969e+01 2.125e+01 1.300e+02 1.203e+03 1.096e-01 1.599e-01 1.974e-01\n",
      "  1.279e-01 2.069e-01 5.999e-02 7.456e-01 7.869e-01 4.585e+00 9.403e+01\n",
      "  6.150e-03 4.006e-02 3.832e-02 2.058e-02 2.250e-02 4.571e-03 2.357e+01\n",
      "  2.553e+01 1.525e+02 1.709e+03 1.444e-01 4.245e-01 4.504e-01 2.430e-01\n",
      "  3.613e-01 8.758e-02]\n",
      " [1.142e+01 2.038e+01 7.758e+01 3.861e+02 1.425e-01 2.839e-01 2.414e-01\n",
      "  1.052e-01 2.597e-01 9.744e-02 4.956e-01 1.156e+00 3.445e+00 2.723e+01\n",
      "  9.110e-03 7.458e-02 5.661e-02 1.867e-02 5.963e-02 9.208e-03 1.491e+01\n",
      "  2.650e+01 9.887e+01 5.677e+02 2.098e-01 8.663e-01 6.869e-01 2.575e-01\n",
      "  6.638e-01 1.730e-01]\n",
      " [2.029e+01 1.434e+01 1.351e+02 1.297e+03 1.003e-01 1.328e-01 1.980e-01\n",
      "  1.043e-01 1.809e-01 5.883e-02 7.572e-01 7.813e-01 5.438e+00 9.444e+01\n",
      "  1.149e-02 2.461e-02 5.688e-02 1.885e-02 1.756e-02 5.115e-03 2.254e+01\n",
      "  1.667e+01 1.522e+02 1.575e+03 1.374e-01 2.050e-01 4.000e-01 1.625e-01\n",
      "  2.364e-01 7.678e-02]]\n"
     ]
    }
   ],
   "source": [
    "from sklearn.datasets import load_breast_cancer\n",
    "from sklearn.linear_model import LogisticRegression\n",
    "# 导入数据\n",
    "cancer = load_breast_cancer()\n",
    "print(\"数据形状\", cancer.data.shape)\n",
    "print(\"标签\",cancer.target_names)\n",
    "print(\"前5条数据\")\n",
    "print(cancer.data[:5])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2023-08-27T04:27:58.615960500Z",
     "start_time": "2023-08-27T04:27:58.579908800Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "测试集精度 0.96\n"
     ]
    }
   ],
   "source": [
    "from sklearn.model_selection import train_test_split\n",
    "from sklearn.preprocessing import MinMaxScaler\n",
    "X_train,X_test,y_train,y_test = train_test_split(cancer.data,cancer.target,random_state=0)\n",
    "# 数据缩放器\n",
    "scaler = MinMaxScaler()\n",
    "scaler.fit(X_train)\n",
    "X_train_scaled = scaler.transform(X_train)\n",
    "X_test_scaled = scaler.transform(X_test)\n",
    "# 构造逻辑回归分类器\n",
    "logr_classification = LogisticRegression()\n",
    "logr_classification.fit(X_train_scaled,y_train)\n",
    "print(\"测试集精度\",round(logr_classification.score(X_test_scaled,y_test),2))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2023-08-27T04:39:58.547940Z",
     "start_time": "2023-08-27T04:39:58.533903800Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "              precision    recall  f1-score   support\n",
      "\n",
      "          恶性       1.00      0.89      0.94        53\n",
      "          良性       0.94      1.00      0.97        90\n",
      "\n",
      "    accuracy                           0.96       143\n",
      "   macro avg       0.97      0.94      0.95       143\n",
      "weighted avg       0.96      0.96      0.96       143\n",
      "\n"
     ]
    }
   ],
   "source": [
    "## 尝试使用其他模型评估指标\n",
    "from sklearn.metrics import classification_report\n",
    "y_pred = logr_classification.predict(X_test_scaled)\n",
    "print(classification_report(y_test,y_pred,target_names=['恶性','良性']))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2023-08-27T04:41:14.862127100Z",
     "start_time": "2023-08-27T04:41:14.787105Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[47  6]\n",
      " [ 0 90]]\n"
     ]
    }
   ],
   "source": [
    "from sklearn.metrics import confusion_matrix\n",
    "print(confusion_matrix(y_test,y_pred))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 尝试使用神经网络诊断乳腺癌"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2023-08-27T11:48:50.955093500Z",
     "start_time": "2023-08-27T11:48:49.870099200Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "测试集精度 0.97\n"
     ]
    }
   ],
   "source": [
    "from sklearn.neural_network import MLPClassifier\n",
    "mlp_classification = MLPClassifier(hidden_layer_sizes=[10,10],max_iter=1200)\n",
    "mlp_classification.fit(X_train_scaled,y_train)\n",
    "print(\"测试集精度\",round(mlp_classification.score(X_test_scaled,y_test),2))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 尝试使用支持向量机诊断乳腺癌"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2023-08-27T12:06:20.800137700Z",
     "start_time": "2023-08-27T12:06:20.449139900Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "最佳验证集精度 0.98\n",
      "最佳参数组合 {'C': 1, 'gamma': 1}\n",
      "测试集精度 0.97\n"
     ]
    }
   ],
   "source": [
    "from sklearn.model_selection import GridSearchCV\n",
    "from sklearn.svm import SVC\n",
    "param_grid = {\"gamma\":[0.01,0.1,1,10,100],'C':[0.01,0.1,1,10,100]}\n",
    "grid = GridSearchCV(SVC(),param_grid=param_grid,cv=5,n_jobs=-1)\n",
    "grid.fit(X_train_scaled,y_train)\n",
    "print(\"最佳验证集精度\",round(grid.best_score_,2))\n",
    "print(\"最佳参数组合\",grid.best_params_)\n",
    "print('测试集精度',round(grid.score(X_test_scaled,y_test),2))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 2023年8月28日\n",
    "### 构造朴素贝叶斯分类器"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2023-08-28T00:35:07.663754300Z",
     "start_time": "2023-08-28T00:35:07.531767700Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[ 8.73  0.31]\n",
      " [ 4.71 -0.42]\n",
      " [ 4.58  6.18]\n",
      " [ 9.38  2.18]\n",
      " [ 4.78  5.28]]\n",
      "[2. 3. 1. 2. 1.]\n",
      "测试集精度 0.99\n"
     ]
    }
   ],
   "source": [
    "from sklearn.model_selection import train_test_split\n",
    "from sklearn.naive_bayes import GaussianNB\n",
    "import numpy as np\n",
    "\n",
    "# 加载数据集\n",
    "filename = \"F:\\python学习资料\\Python-Machine-Learning-Cookbook-master\\Chapter02\\data_multivar.txt\"\n",
    "X,y = [],[]\n",
    "with open(filename,'r') as f:\n",
    "    for line in f.readlines():\n",
    "        data = [float(x) for x in line.split(',')]\n",
    "        X.append(data[:-1])\n",
    "        y.append(data[-1])\n",
    "\n",
    "X = np.array(X)\n",
    "y = np.array(y)\n",
    "\n",
    "print(X[:5])\n",
    "print(y[:5])\n",
    "\n",
    "X_train,X_test,y_train,y_test = train_test_split(X,y,random_state=0)\n",
    "nb_classifier = GaussianNB()\n",
    "nb_classifier.fit(X_train,y_train)\n",
    "print(\"测试集精度\",round(nb_classifier.score(X_test,y_test),2))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2023-08-28T00:45:07.848347100Z",
     "start_time": "2023-08-28T00:45:07.826316900Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "测试集精度 0.933\n"
     ]
    }
   ],
   "source": [
    "from sklearn.datasets import load_wine\n",
    "wine = load_wine()\n",
    "X_train,X_test,y_train,y_test = train_test_split(wine.data,wine.target,random_state=0)\n",
    "nb_classifier.fit(X_train,y_train)\n",
    "print(\"测试集精度\",round(nb_classifier.score(X_test,y_test),3))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2023-08-28T00:44:59.798014700Z",
     "start_time": "2023-08-28T00:44:59.786017300Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "测试集精度 0.933\n"
     ]
    }
   ],
   "source": [
    "# 使用管道给贝叶斯做预处理\n",
    "from sklearn.pipeline import Pipeline\n",
    "from sklearn.preprocessing import MinMaxScaler\n",
    "pipe = Pipeline([('scaler',MinMaxScaler()),('nb_classifier',GaussianNB())])\n",
    "pipe.fit(X_train,y_train)\n",
    "print(\"测试集精度\",round(pipe.score(X_test,y_test),3))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2023-08-28T00:48:11.324206200Z",
     "start_time": "2023-08-28T00:48:09.504361300Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "测试集精度 1.0\n"
     ]
    }
   ],
   "source": [
    "from sklearn.linear_model import LogisticRegression\n",
    "# 逻辑回归对比\n",
    "pipe_logist = Pipeline([('scaler',MinMaxScaler()),('log_classifier',LogisticRegression())])\n",
    "pipe_logist.fit(X_train,y_train)\n",
    "print(\"测试集精度\",round(pipe_logist.score(X_test,y_test),3))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 梯度提升树"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2023-08-28T12:54:57.267568200Z",
     "start_time": "2023-08-28T12:54:56.015568400Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "测试集精度 0.867\n",
      "测试集精度 0.867\n"
     ]
    }
   ],
   "source": [
    "from sklearn.ensemble import AdaBoostClassifier\n",
    "from sklearn.datasets import load_wine\n",
    "from sklearn.model_selection import train_test_split\n",
    "from sklearn.pipeline import Pipeline\n",
    "from sklearn.preprocessing import MinMaxScaler\n",
    "wine = load_wine()\n",
    "X_train,X_test,y_train,y_test = train_test_split(wine.data,wine.target,random_state=0)\n",
    "boost_classifier = AdaBoostClassifier(n_estimators=100)\n",
    "boost_classifier.fit(X_train,y_train)\n",
    "pipe = Pipeline([(\"scaler\",MinMaxScaler()),(\"classifier\",AdaBoostClassifier(n_estimators=500))])\n",
    "print(\"测试集精度\",round(boost_classifier.score(X_test,y_test),3))\n",
    "pipe.fit(X_train,y_train)\n",
    "print(\"测试集精度\",round(pipe.score(X_test,y_test),3))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2023-08-28T12:26:57.946207300Z",
     "start_time": "2023-08-28T12:26:57.922995100Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "测试集精度 1.0\n"
     ]
    }
   ],
   "source": [
    "from sklearn.svm import SVC\n",
    "svc_pipeline = Pipeline([(\"scaler\",MinMaxScaler()),(\"SVC\",SVC())])\n",
    "svc_pipeline.fit(X_train,y_train)\n",
    "print(\"测试集精度\",round(svc_pipeline.score(X_test,y_test),3))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2023-08-28T13:03:24.314408900Z",
     "start_time": "2023-08-28T13:03:24.262404100Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "测试集 0.98\n",
      "测试集 0.98\n"
     ]
    }
   ],
   "source": [
    "from sklearn.ensemble import BaggingClassifier\n",
    "bag_classifier = BaggingClassifier(random_state=0)\n",
    "bag_classifier.fit(X_train,y_train)\n",
    "print(\"测试集\",round(bag_classifier.score(X_test,y_test),2))\n",
    "# 管道\n",
    "bag_pipe = Pipeline([('scaler',MinMaxScaler()),('classifier',BaggingClassifier(random_state=0))])\n",
    "bag_pipe.fit(X_train,y_train)\n",
    "print(\"测试集\",round(bag_pipe.score(X_test,y_test),2))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
